<template>
    <div id="cesiumContainer"></div>
</template>

<script setup lang="ts">
import { Cartesian3, Cartographic, Cesium3DTileset, ClassificationType, EllipseGeometry, Model, Transforms, Viewer, WebMercatorProjection } from 'cesium';
import { onMounted } from 'vue';
var modelMatrix = Transforms.eastNorthUpToFixedFrame(
    Cartesian3.fromDegrees(102, 30, 0)
);
console.log(modelMatrix);
// var destination = Cesium.Cartesian3.fromDegrees(longitude, latitude, height + 100); // 你可以调整这个高度值
onMounted(async () => {
    const viewer = new Viewer('cesiumContainer');
    const rectangle = viewer.camera.computeViewRectangle();
    const projection = new WebMercatorProjection();
    // EllipseGeometry

// 创建一个经纬度点（例如，北京）
    const cartographic = Cartographic.fromDegrees(116.391, 39.907);

// 将经纬度转换为 Web Mercator 坐标
    const webMercatorCoords = projection.project(cartographic);

    console.log('Web Mercator 坐标:', webMercatorCoords); // 输出 Web Mercator 坐标
})

</script>

<style scoped>
#cesiumContainer {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
</style>
